summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-09-04 16:29:45 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-09-04 16:29:45 +0200
commit15896e0e50a12adb0e9c47c855635f3569c5a70d (patch)
tree4ab23c0ce2b9eeaaf1f17b38f8277281a741d61f
parentaebd6c8aed34b744ccf41fcdbd0ae4aedf965964 (diff)
downloadChimère - projet Saclay-15896e0e50a12adb0e9c47c855635f3569c5a70d.tar.bz2
Chimère - projet Saclay-15896e0e50a12adb0e9c47c855635f3569c5a70d.zip
Static page before site opening
-rw-r--r--site_static/css/home.css67
-rw-r--r--site_static/img/dorian_off.pngbin0 -> 3393 bytes
-rw-r--r--site_static/img/dorian_on.pngbin0 -> 3620 bytes
-rw-r--r--site_static/img/footer.pngbin0 -> 553 bytes
-rw-r--r--site_static/img/header.pngbin0 -> 48911 bytes
-rw-r--r--site_static/img/lea_off.pngbin0 -> 3376 bytes
-rw-r--r--site_static/img/lea_on.pngbin0 -> 3556 bytes
-rw-r--r--site_static/img/logo.pngbin0 -> 18442 bytes
-rw-r--r--site_static/img/ok.pngbin0 -> 257 bytes
-rw-r--r--site_static/img/popup.pngbin0 -> 1698 bytes
-rw-r--r--site_static/img/sabine_off.pngbin0 -> 2094 bytes
-rw-r--r--site_static/img/sabine_on.pngbin0 -> 2280 bytes
-rw-r--r--site_static/img/savoir_off.pngbin0 -> 3060 bytes
-rw-r--r--site_static/img/savoir_on.pngbin0 -> 3063 bytes
-rw-r--r--site_static/img/telecharger_off.pngbin0 -> 3162 bytes
-rw-r--r--site_static/img/telecharger_on.pngbin0 -> 3229 bytes
-rw-r--r--site_static/index.php77
-rw-r--r--site_static/lib/.htaccess1
-rw-r--r--site_static/lib/db.php.sample19
-rw-r--r--site_static/lib/functions.php45
20 files changed, 209 insertions, 0 deletions
diff --git a/site_static/css/home.css b/site_static/css/home.css
new file mode 100644
index 0000000..63ef79b
--- /dev/null
+++ b/site_static/css/home.css
@@ -0,0 +1,67 @@
+/* CSS Document */
+
+/* CSS Document */
+
+@charset "iso-8859-1";
+body {
+font-family: arial;
+font-size: 10px;
+color: #000000;
+margin: 0px;
+padding: 0px;
+background-color: #fff;
+
+}
+
+#frm-response{
+ display:none;
+}
+
+#new_body {
+left: 50%;
+margin-right: auto;
+margin-left: -300px;
+width: 599px;
+height: auto;
+background:#ffffff;
+padding: 0px;
+position: absolute !important; /* pour FF */
+position: relative; /* pour IE */
+border-right:1px solid #adb3b8;
+}
+
+a img {border:0; margin:0px;
+padding:0px;background:none;display: block; }
+img {border:0; margin:0px;
+padding:0px;background:none;display: block;}
+
+#header {width:599px;height:500px;padding:0px;margin:0px;background-image: url(../img/header.png);}
+
+#link {width:599px;height:30px;padding:0px;margin:0px;}
+#link2 {width:599px;height:20px;padding:0px;margin:0px;}
+
+#img {width:599px;height:auto;padding:0px;margin:0px;}
+
+.box {
+height:18px;
+width:218px;
+border: 0px #99B19A solid;
+font-family:Arial, Helvetica, sans-serif;
+color:#ffffff;
+background:#677B92;
+font-weight:bold;
+font-size: 11px;
+padding: 2px;
+margin-top:456px;
+margin-left:189px;}
+
+.ok {
+ width:22px;
+ height:22px;
+ float:right;
+ margin-right:160px;
+ margin-top:456px;
+}
+.ok:hover{
+ cursor:pointer;
+}
diff --git a/site_static/img/dorian_off.png b/site_static/img/dorian_off.png
new file mode 100644
index 0000000..0b05d59
--- /dev/null
+++ b/site_static/img/dorian_off.png
Binary files differ
diff --git a/site_static/img/dorian_on.png b/site_static/img/dorian_on.png
new file mode 100644
index 0000000..9ca4b93
--- /dev/null
+++ b/site_static/img/dorian_on.png
Binary files differ
diff --git a/site_static/img/footer.png b/site_static/img/footer.png
new file mode 100644
index 0000000..483182b
--- /dev/null
+++ b/site_static/img/footer.png
Binary files differ
diff --git a/site_static/img/header.png b/site_static/img/header.png
new file mode 100644
index 0000000..72b380d
--- /dev/null
+++ b/site_static/img/header.png
Binary files differ
diff --git a/site_static/img/lea_off.png b/site_static/img/lea_off.png
new file mode 100644
index 0000000..189711b
--- /dev/null
+++ b/site_static/img/lea_off.png
Binary files differ
diff --git a/site_static/img/lea_on.png b/site_static/img/lea_on.png
new file mode 100644
index 0000000..e685ee3
--- /dev/null
+++ b/site_static/img/lea_on.png
Binary files differ
diff --git a/site_static/img/logo.png b/site_static/img/logo.png
new file mode 100644
index 0000000..c43bf46
--- /dev/null
+++ b/site_static/img/logo.png
Binary files differ
diff --git a/site_static/img/ok.png b/site_static/img/ok.png
new file mode 100644
index 0000000..3562528
--- /dev/null
+++ b/site_static/img/ok.png
Binary files differ
diff --git a/site_static/img/popup.png b/site_static/img/popup.png
new file mode 100644
index 0000000..0ee2a5d
--- /dev/null
+++ b/site_static/img/popup.png
Binary files differ
diff --git a/site_static/img/sabine_off.png b/site_static/img/sabine_off.png
new file mode 100644
index 0000000..7a5801f
--- /dev/null
+++ b/site_static/img/sabine_off.png
Binary files differ
diff --git a/site_static/img/sabine_on.png b/site_static/img/sabine_on.png
new file mode 100644
index 0000000..e2eea66
--- /dev/null
+++ b/site_static/img/sabine_on.png
Binary files differ
diff --git a/site_static/img/savoir_off.png b/site_static/img/savoir_off.png
new file mode 100644
index 0000000..01cb5e0
--- /dev/null
+++ b/site_static/img/savoir_off.png
Binary files differ
diff --git a/site_static/img/savoir_on.png b/site_static/img/savoir_on.png
new file mode 100644
index 0000000..43b55bc
--- /dev/null
+++ b/site_static/img/savoir_on.png
Binary files differ
diff --git a/site_static/img/telecharger_off.png b/site_static/img/telecharger_off.png
new file mode 100644
index 0000000..3f25c7f
--- /dev/null
+++ b/site_static/img/telecharger_off.png
Binary files differ
diff --git a/site_static/img/telecharger_on.png b/site_static/img/telecharger_on.png
new file mode 100644
index 0000000..f6210b7
--- /dev/null
+++ b/site_static/img/telecharger_on.png
Binary files differ
diff --git a/site_static/index.php b/site_static/index.php
new file mode 100644
index 0000000..aca8a6a
--- /dev/null
+++ b/site_static/index.php
@@ -0,0 +1,77 @@
+<?php echo('<?xml version="1.0" encoding="UTF-8"?>'); ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<?php include('lib/functions.php'); ?>
+<html>
+<head>
+<title>Carte OuVerte du plateau de Saclay</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+<link href="css/home.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
+<script language="JavaScript" type="text/JavaScript">
+<!--
+function MM_swapImgRestore() { //v3.0
+ var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
+}
+
+function MM_preloadImages() { //v3.0
+ var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
+ var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
+ if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
+}
+
+function MM_findObj(n, d) { //v4.01
+ var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
+ d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
+ if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
+ for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
+ if(!x && d.getElementById) x=d.getElementById(n); return x;
+}
+
+function MM_swapImage() { //v3.0
+ var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
+ if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
+}
+
+var initialized = false;
+$(function(){
+ $('.ok').click(function(){
+ $('#main_form').submit();
+ });
+ $('input[name="courrel"]').click(function(){
+ if (!initialized){
+ initialized = true;
+ $("input[name='courrel']").val('');
+ }
+ });
+<?php
+
+if($_POST['courrel']){
+$ip = $_SERVER['REMOTE_ADDR'];
+if(!checkIP($ip)){
+ echo('alert("Trop de d\'adresses de courriel ont été enregistrées depuis votre réseau. Veuillez renouveller votre demande un autre jour. Merci.");');
+} else if(checkEmail($_POST['courrel'])){
+ addEmail($_POST['courrel'], $ip);
+ echo('alert("Votre adresse de courriel '.$_POST['courrel'].' a bien été enregistrée. Merci de votre intérêt ! Nous vous tiendrons informé dans les prochains jours.");');
+}else{
+ echo('alert("L\'adresse '.$_POST['courrel'].' est incorrecte. Elle a déjà été enregistrée ou ce n\'est pas une adresse valide.");');
+};
+
+}?>
+});
+//-->
+</script>
+</head>
+
+<body onLoad="MM_preloadImages('img/telecharger_on.png','img/savoir_on.png','img/dorian_on.png','img/lea_on.png','img/sabine_on.png')">
+<div id="new_body">
+<div id="header">
+<form action="." method="post" id='main_form'><input name="courrel" type="text" class="box" value="adresse de courriel"><img src="img/ok.png" class="ok"></form></div>
+<div id="link"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','img/telecharger_on.png',1)"><img src="img/telecharger_off.png" name="Image2" width="599" height="30" border="0"></a></div>
+<div id="link"><a href="http://bit.ly/SmQpga" target="_blank" onMouseOver="MM_swapImage('Image3','','img/savoir_on.png',1)" onMouseOut="MM_swapImgRestore()"><img src="img/savoir_off.png" name="Image3" width="599" height="30" border="0"></a></div>
+<div id="img"><img src="img/logo.png"></div>
+ <div id="link2"><a href="mailto:dorian.spaak@terreetcite.org" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','img/dorian_on.png',1)"><img src="img/dorian_off.png" name="Image4" width="599" height="20" border="0"></a></div>
+ <div id="link2"><a href="mailto:leamarzloff@groupechronos.org" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','img/lea_on.png',1)"><img src="img/lea_off.png" name="Image5" width="599" height="20" border="0"></a></div>
+ <div id="link2"><a href="mailto:sdarmaillacq@gmail.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','img/sabine_on.png',1)"><img src="img/sabine_off.png" name="Image6" width="599" height="20" border="0"></a></div>
+<div id="img"><img src="img/footer.png"></div>
+</div>
+</body>
+</html>
diff --git a/site_static/lib/.htaccess b/site_static/lib/.htaccess
new file mode 100644
index 0000000..3a42882
--- /dev/null
+++ b/site_static/lib/.htaccess
@@ -0,0 +1 @@
+Deny from all
diff --git a/site_static/lib/db.php.sample b/site_static/lib/db.php.sample
new file mode 100644
index 0000000..4cfa9be
--- /dev/null
+++ b/site_static/lib/db.php.sample
@@ -0,0 +1,19 @@
+<?php
+$config = array (
+ 'db_name' => 'plouf',
+ 'db_host' => 'localhost',
+ 'db_user' => 'plouf',
+ 'db_pass' => 'plouf',
+);
+
+function opendb(){
+ global $config;
+ $db_link = mysql_connect($config['db_host'], $config['db_user'], $config['db_pass']) or die ('Error connecting to mysql');
+ mysql_select_db($config['db_name']);
+ return $db_link;
+}
+function closedb($db_link){
+ return mysql_close($db_link);
+}
+?>
+
diff --git a/site_static/lib/functions.php b/site_static/lib/functions.php
new file mode 100644
index 0000000..061ec12
--- /dev/null
+++ b/site_static/lib/functions.php
@@ -0,0 +1,45 @@
+<?php
+include('db.php');
+function checkEmail($email) {
+$db = opendb();
+$sql = "select email from email where email='".$email."';";
+$res = mysql_fetch_array(mysql_query($sql));
+if($res){
+closedb($db);
+return 0;
+}
+ if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/" , $email)){
+ list($username,$domain) = split('@', $email);
+ if(!checkdnsrr($domain,'MX')){
+ closedb($db);
+ return false;
+ }
+ closedb($db);
+ return true;
+ }
+ closedb($db);
+ return false;
+}
+
+function addEmail($email, $ip) {
+$db = opendb();
+$sql = "insert into email (email, ip, date) values
+ ('".$email."', '".$ip."', '".date('Y-m-d')."')";
+mysql_query($sql);
+closedb($db);
+}
+
+function checkIP($ip) {
+$db = opendb();
+$today = date('Y-m-d');
+$sql = "select count(id) from email where ip='".$ip."' and date='".$today."';";
+$res = mysql_fetch_array(mysql_query($sql));
+
+if($res and $res[0] >= 100){
+ closedb($db);
+ return 0;
+}
+closedb($db);
+return 1;
+}
+?>